package com.example.snap_it;





import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends ActivityComMusicaFundo {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}
	
	@Override
	protected void onPause()
	{
		
		//TocadorMusicaBackground.getInstance().pausarTocadorMusica();
		if(this.isFinishing())
		{
			Toast.makeText(MainActivity.this, "is finishing will stop service", Toast.LENGTH_SHORT).show();
			Intent iniciaMusicaFundo = new Intent(MainActivity.this, BackgroundSoundService.class);
			stopService(iniciaMusicaFundo);
		}
		super.onPause();
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	public void mostrarRegrasUmJogador(View view)
	{
		Intent criaTelaRegrasUmJogador =
				new Intent(MainActivity.this, RegrasActivity.class);
		startActivity(criaTelaRegrasUmJogador);
	}
	
	public void mostrarRegrasDoisJogadores(View view)
	{
		Intent criaTelaRegrasDoisJogadores =
				new Intent(MainActivity.this, RegrasDoisJogadoresActivity.class);
		startActivity(criaTelaRegrasDoisJogadores);
	}
	
	public void minhasListasDeDicas(View v)
	{
		Intent criaTelaMinhasListasDeDicas =
				new Intent(MainActivity.this, VisualizarListasDeDicasDoUsuario.class);
		startActivity(criaTelaMinhasListasDeDicas);
	}
	
	public void listarAlbunsDeFotosSalvas(View v)
	{
		Intent criaTelaListarAlbunsDeFotos = 
				new Intent(MainActivity.this, ListarAlbunsDeFotosTiradas.class);
		startActivity(criaTelaListarAlbunsDeFotos);
	}

}
